<?php

/**
 * This is the model class for table "config_option_value".
 *
 * The followings are the available columns in table 'config_option_value':
 * @property string $id
 * @property string $config_id
 * @property string $label
 * @property string $value
 * @property integer $status
 * @property string $sorder
 */
class ConfigOptionValue extends ConfigOptionValuePeer
{
    var $className = __CLASS__;
	
	/**
	 * Returns the static model of the specified AR class.
	 * @return ConfigOptionValue the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

    public static function dumpAllValueToArray($configId)
    {
        $array   = array();
        $criteria = new CDbCriteria();
        $criteria->select = "id, label, value";
        $criteria->condition = "config_id = $configId";
        $criteria->order = "label, id";
        $items = ConfigOptionValue::model()->findAll($criteria);
        foreach($items as $item){
            $array[$item->value] = $item->label;
        }
        return $array;
    }
}